//
//  ViewController.m
//  CYHScrollTitle
//
//  Created by iOS开发 on 2018/8/13.
//  Copyright © 2018年 iOS开发. All rights reserved.
//

#import "ViewController.h"
#import "ScrollTitleView.h"
#import <Masonry.h>

@interface ViewController ()
@property (nonatomic, strong) ScrollTitleView *scrollView;
@end

@implementation ViewController

- (void)viewDidLoad {
    [super viewDidLoad];
    // Do any additional setup after loading the view, typically from a nib.
    
    
    // 滚动试图
    _scrollView = [[ScrollTitleView alloc] initWithShowArr:@[UIColor.redColor,UIColor.grayColor,UIColor.blueColor,UIColor.blackColor,UIColor.purpleColor,UIColor.redColor] ShowCount:2 scrollContent:90];
    _scrollView.backgroundColor = [UIColor yellowColor];
    _scrollView.clipsToBounds = YES;
    [self.view addSubview:_scrollView];
    
    [_scrollView mas_makeConstraints:^(MASConstraintMaker *make) {
        make.left.mas_equalTo(self.view).with.offset(30);
        make.right.mas_equalTo(self.view).with.offset(-30);
        make.center.mas_equalTo(self.view);
        make.height.mas_equalTo(90);
    }];
    
    
    [_scrollView startAnimation];
    
}

- (void)viewDidDisappear:(BOOL)animated {
    [super viewDidDisappear:animated];
    [_scrollView stopAnimation];
}

- (void)didReceiveMemoryWarning {
    [super didReceiveMemoryWarning];
    // Dispose of any resources that can be recreated.
}


@end
